package com.squid.monitor.controller;

import com.squid.base.common.bean.Return;
import com.squid.base.utils.SystemMonitorUtils;
import com.squid.base.utils.system.ServerInfo;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/monitor")
public class MonitorController {
    @Resource
    SystemMonitorUtils systemMonitorUtils;

    /**
     * 获取服务器信息
     *
     * @return {@link Return }<{@link ServerInfo }>
     */
    @PostMapping("getServerInfo")
    public Return<ServerInfo> getServerInfo() {
        ServerInfo serverInfo = systemMonitorUtils.getServerInfo();
        return Return.<ServerInfo>success().data(serverInfo);
    }
}
